<template>
  <div>
    <div>账号切换</div>
    <button @click="zhangsan()" type="default" size="mini">张三</button>
    <button @click="lisi()" type="default" size="mini">李四</button>
    <button @click="zzjl()" type="default" size="mini">张总经理</button>
    <button @click="admin()" type="default" size="mini">admin</button>
    <div>当前token：{{ token }}</div>
  </div>
</template>

<script>
export default {
  name: "Test",

  data() {
    return {
      token: ''
    };
  },

  created(){
    this.token = window.localStorage.getItem('token')
  },

  methods: {
    admin() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDcyNDcxMTe10FEqLU4t8kwBikGYeYm5qUAtiSm5mXlKtQAcgM93QgAAAA.qtEh6JMMQEAbtm-gWhOaL2dZwObnxkx8642tpa5WUPpvmySpx6_p6gyEIc-V3DDOuV1fe_2o691jLR1i7w_cUg'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },
    zhangsan() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDcytDA2NDM111EqLU4t8kxRsoIy8xJzU4FaqjIS89KLE_OUagEgW9IfRQAAAA.EOA33dV_y5xPLovi0GncPHPcSLhN7CI0KR1crhytOdumbVKi9XW_5tCSHpGivvkKllc8X0_Q0_G0Cs8HiufYFw'
      window.localStorage.setItem('token', token);
      console.log(token);
      this.token = window.localStorage.getItem('token')
    },
    zzjl() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDcyNDcxsTA21FEqLU4t8kwBikGYeYm5qUAtVVVZOUq1ALldsJFBAAAA.3j4VKhZCNb2yu7UMXoiiO4X4dCk26HtcDjbERdX4ZVr9bwNPL5BDfDFgCZWYMxMkSDXbK67U3PriLUKQAnKNjg'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    },
    lisi() {
      window.localStorage.setItem('token', '');
      let token = 'eyJhbGciOiJIUzUxMiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAAAKtWKi5NUrJScgwN8dANDXYNUtJRSq0oULIyNDcyNDcxsTQ00VEqLU4t8kwBikGYeYm5qUAtOZnFmUq1AOBd6nNBAAAA._jnI5TPnwRX_y5MQn80w8loxIrjESSGNDHfUqZH3Jlv6eesZc8QTJcpQVY2bzALTI4WeiGlIJRe2nXLhjwgATw'
      window.localStorage.setItem('token', token);
      this.token = window.localStorage.getItem('token')
    }
  }
}
</script>
